<?php

/**
 * @Author: wuchenge
 * @Date:   2021-12-13 18:02:24
 * @Email: ligui0506@126.com
 * @Descript:
 */
namespace App\Transformer;

class AdminTransformer extends Transformer
{

    /**
     * [transform description]
     * @param  [type] $lesson [description]
     * @return [type]         [description]
     */
    public function transform($admin)
    {
        // 说明是集合 Illuminate
        if (!is_array($admin)) {
            $admin = $admin->toArray();
        }

        return [
            'id'         => $admin['id'],
            'username'   => $admin['username'],
            'nickname'   => $admin['nickname'],
            'status'     => $admin['status'],
            'updated_at' => $admin['updated_at'],
        ];
    }
}
